﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<c:set var="contextPath" value="<%=getServletContext().getContextPath()%>" />
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>MCE|Job Information- Simplex</title>
    <link rel="stylesheet" href="${contextPath }/resources/css/mce.css"></link>
    <link rel="stylesheet" href="${contextPath }/resources/css/size.css" ></link>
    <link rel="stylesheet" href="${contextPath }/resources/css/jquery-ui.css" ></link>
    <link href='http://fonts.googleapis.com/css?family=Lato:400,300,700,400italic' rel='stylesheet' type='text/css' ></link>
    <script type="text/javascript" src="${contextPath }/resources/js/jquery/jquery-1.10.1.js"></script>
    <script type="text/javascript" src="${contextPath }/resources/js/jquery-ui/jquery-ui.js"></script>
    <script type="text/javascript" src="${contextPath }/resources/js/validation/validation.js"></script>
    <script type="text/javascript" src="${contextPath }/resources/js/client/QuoteProcess.js"></script>    
</head>
<body>
	<c:set var="currentStep" value="${quoteProcessModel.currentStep}" />
	<c:set var="mceMenu" value="${quoteProcessModel.mceMenu}" />
    <c:set var="quoteProcessSteps" value="${quoteProcessModel.steps}" />
    <input type="hidden" id="contextRoot" value="${contextPath}"/>
    <div class="mceContainer">
        <!--HOME BANNER CONTAINER-->
        <div class="afterHeaderContainer">
            <!--NAVIGATION MENU-->
            <div class="navigationContainer">
                <table class="menuItemContainer">
                    <tr>
                        <!--MCE WEBSITE LINK-->
                        <td class="wd_90">
                            <a class="mceinc" target="_blank" href="http://www.mceinc.com">
                                <img style="border:none;" src="${contextPath }/resources/images/element.png" />
                            </a>
                        </td>
                        <!--/MCE WEBSITE LINK-->
                        <!--NEW QUOTE LINK-->
                        <td class="wd_90 menuLink">
                            <a href="${contextPath}/create-quote">New quote</a>
                        </td>
                        <!--/NEW QUOTE LINK-->
                        <!--ACCOUNT LINK-->
                        <td class="wd_90 menuLink">
                            <a href="${contextPath}/mce-account">Account</a>
                        </td>
                        <!--/ACCOUNT LINK-->

                        <!--MCE WEBSITE LINK-->
                        <td class="logo">
                            <a target="_blank" href="http://www.mceinc.com">
                                 <img src="${contextPath }/resources/images/MCE-Mainsite-Icon.png" />
                            </a>
                        </td>
                        <!--/MCE WEBSITE LINK-->
                    </tr>
                </table>
            </div>
            <!--/NAVIGATION MENU-->
        </div>
        <!--/HOME BANNER CONTAINER-->
        <!--MAIN CONTAINER-->
        <div class="mainContainer" style="width: 1100px;">
            <table class="wrapContainer">
                <tr>
                    <td class="left" style="width: 20%;">
                        <!--LEFT CONTAINER-->
                        <div class="wrapDataContainer borderRight">
                            <p class="subject" style="width:200px;">New Quote</p>
                            <p>To create a new quote, please complete the steps below. Once submitted, we will provide a PDF quote. </p>
                            <br />
                            <h2 class="font17">Quote Process</h2>
                            <div class="quoteProcessContainer">
                            	<c:forEach var="mceMenu" items="${mceMenu}" varStatus="status">
									<div class="${mceMenu._GROUP_NAME==currentStep._GROUP_NAME?'quote-process-item-active':'quote-process-item'}">
										<span style="margin-left: ${mceMenu._PADDING_LEFT}px;">
											<c:out value="${mceMenu._GROUP_TEXT}" />
                                   		</span>
									</div>
								</c:forEach>
                            </div>
                        </div>
                        <!--/LEFT CONTAINER-->
                    </td>
                    <td>
                        <!--BODY CONTAINER-->
                        <div class="wrapDataContainer">
                            <div class="title" style="text-transform: uppercase;">
                                <c:out value="${currentStep._GROUP_TEXT}"/>
                            </div>
                            <c:if test="${currentStep._TEXT_DESCRIPTION!=null}">
                            	<div class="wrap-item-container">
	                                <p class="dashboad-description">
	                                    <c:out value="${currentStep._TEXT_DESCRIPTION}"/>
	                                </p>
	                            </div>
                            </c:if>
                            <c:if test="${currentStep._JOBNAME!=null}">
                            	 <div class="wrap-item-container wd_500">
	                               	<p class="mceTextOrange">
	                                    JOB NAME: <span class="bold colorDefault">
	                                    	 <c:out value="${currentStep._JOBNAME}"/>
	                                    </span>
	                                </p>
	                            </div> 
                            </c:if>
                            <div class="wd_445 mce-align-center">
                            	<form:form method="POST" modelAttribute="quoteProcessModel" >
                            		<c:forEach var="characteristic" items="${quoteProcessModel.characteristics}">
                            			<c:if test="${characteristic.value._GROUP_NAME==currentStep._GROUP_NAME}">
                            				<div class="wrap-item-container wd_500">
			                                    <div class="html-control-container">
			                                        <div class="label-wrap wd_185">
			                                        	${characteristic.value._DESCR_CHAR}
			                                        	<c:if test="${characteristic.value._ENTRY_OBLIGATORY==true}">
			                                        		<span class="required">*</span>
                                            			</c:if>
			                                        </div>
			                                        <div class="field-wrap">
			                                            <table class="mce">
			                                            	<tr>
			                                            		<td>
			                                            			<c:if test="${characteristic.value.characteristicDataType=='input'}">
			                                            				<input type="text" class="mce wd_220" name="${characteristic.key}" value="${characteristic.value._DEFAULT_VALUE}"></input>
			                                            			</c:if>
			                                            			<c:if test="${characteristic.value.characteristicDataType=='select'}">
			                                            				<select name="${characteristic.key}" class="mce wd_220">
							                                                <optgroup label="Select">
							                                                	<c:forEach items="${characteristic.value.collectionValues}" var="element"> 
																				    <option 
																				    	<c:if test="${characteristic.value._DEFAULT_VALUE ==element._STRING }">
																				    		selected="selected"
																				    	</c:if>
																				    	 value="${element._STRING}">
							                                                			<c:out value="${element._ATWTB}"/>
							                                                		</option>
																				</c:forEach>
							                                                </optgroup>
							                                            </select> 
			                                            			</c:if>
			                                            		</td>
			                                            		<c:if test="${characteristic.value._ENTRY_OBLIGATORY==true}">
				                                            		<td class="wd_14">
			                                            				<p class="span-error-ico" title="${characteristic.value._DESCR_CHAR} is required"></p>
				                                            		</td>
			                                            		</c:if>
			                                            		<td class="wd_14">
			                                            			<c:if test="${characteristic.value._SYSTEM_CHARACTERISTIC==true}">
			                                            				<p class="info-ico" title="${characteristic.value._DESCR_CHAR}"></p>
			                                            			</c:if>
			                                            		</td>
			                                            	</tr>
			                                            </table>
			                                        </div>
			                                    </div>
			                                </div>
                            			</c:if>
                            		</c:forEach>
                            		 <div class="wrap-item-container wd_500" style="margin-top:20px;">
	                                    <center><span style="color:#EE7000">(*) Mandatory Field</span></center>
	                                </div>
	                                 <div class="wrap-item-container wd_500">
	                                    <div class="buttonContainer">
	                                    	<c:if test="${currentStep.hasBackButton==true}">
	                                    		<button name="navigateStep" style="float:none" class="mce back" value="${currentStep.backStepCode}">
	                                    			<c:out value="${currentStep.backButtonText}"></c:out>
	                                    		</button>
	                                    	</c:if>
	                                    	<c:if test="${currentStep.hasNextButton==true}">
	                                    		<button name="navigateStep" style="float:none" class="mce" value="${currentStep.nextStepCode}">
	                                    			<c:out value="${currentStep.nextButtonText}"></c:out>
	                                    		</button>
	                                    	</c:if>
	                                    </div>
	                                </div>
                            	</form:form>
                            </div>

                        </div>
                        <!--/BODY CONTAINER-->
                    </td>
                    <td class="right" style="width: 20%;">
                        <%@include file="../../right-include/right.jsp" %>
                    </td>
                </tr>
            </table>
        </div>
        <!--/MAIN CONTAINER-->
        <!--FOOTER CONTAINER-->
        <div class="footerContainer">
            <img src="${contextPath }/resources/images/Nidec.jpg" />
            <img src="${contextPath }/resources/images/MCE.jpg" />
            <div class="clearBoth" />
            <p class="copyRight">Copyright 2014 Motion Control Engineering. All Rights Reserved</p>
        </div>
        <!--/FOOTER CONTAINER-->
    </div>

</body>
</html>
